package blancosMikel.model.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import blancosMikel.model.config.serviceLocator;

public class SigaabmDAO {

	Connection conn;
	PreparedStatement ps;
	Statement st;
	ResultSet rs;

	serviceLocator service = serviceLocator.getInstance();

	protected Connection getConnectionMYSQL() throws SQLException {
		return service.getMYSQLConnection();
	}

	protected static void close(Connection conn) {
		try {
			if (conn != null) {
				conn.close();
			}
		} catch (Exception error) {
			error.printStackTrace();
		}
	}

	protected static void close(PreparedStatement ps) {
		try {
			if (ps != null) {
				ps.close();
			}
		} catch (Exception error) {
			error.printStackTrace();
		}
	}

	protected static void close(ResultSet rs) {
		try {
			if (rs != null) {
				rs.close();
			}
		} catch (Exception error) {
			error.printStackTrace();
		}
	}

	protected static void close(Statement st) {
		try {
			if (st != null) {
				st.close();
			}
		} catch (Exception error) {
			error.printStackTrace();
		}
	}
}
